<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
//use Illuminate\Support\Facades\Schema;

class CreateMsgBoardTable20230810 extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('msg_board', function (Blueprint $table) {
            $table->id();
            $table->string('mini_type', 50)->comment('小程序类型');
            $table->bigInteger('member_id')->unsigned()->comment('用户id');
            $table->string('content')->comment('内容');
            $table->string('re_content')->default('')->comment('回复内容');
            $table->integer('re_time')->default(0)->comment('回复时间');
            $table->integer('re_id')->default(0)->comment('回复者id');
            $table->tinyInteger('state')->default(0)->comment('状态 0-未回复 1-已回复');
            $table->timestamps();
            $table->index(['mini_type', 'member_id']);
            $table->comment = '留言表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('msg_board');
    }
}
